load ListBlock,References,AttachData,SourceButtons

! Start template
#tagKey="NAME details"
Title @this.altview&" - "&local(#tagKey)

! Name Details
cell GroupBox,local(#tagKey)
  width -1
  SetTab 120
  Show TYPE "nameType"
  if firstword(@contents)="NAME"
    hskip 20
    cell label,"Soundex:"
    sizetofit
    cell static soundex(@this.NAME.surname)
    sizetofit
    
    newline
    ! will pass NAME and #
    if @parent.contents!=""
      Show LANG @contents
    endif
  endif
  
  Show NICK
  ShowAll NICK
  ShowAll NPFX
  ShowAll GIVN
  ShowAll SPFX
  ShowAll SURN
  ShowAll NSFX
EndGroup

if firstword(@contents)!="TRAN"
  cell GroupBox,local("Translations")
    width -1
    SetTab 100
    ! passes NAME number
    #numTRAN=0
    show TRAN @contents
    showAll TRAN @contents
  EndGroup
endif

! --------- NOTE, SOUR, and _LOG ----------
#numSOURs=@count.SOUR
gosub References,"_LOG"

! --------- Attach links
newline
cell GroupBox,local("Attach")
  width -1
  newline -#lineSkip-3
  #lineSkip=0
  Show NOTE
  Show SOUR
  Show _LOG
  GoSub AttachData
  GoSub SourceButtons,"true",#numSOURs
EndGroup
#lineSkip=#lineSkip$

optionaltag NPFX,local("NPFX")
optionaltag GIVN,local("GIVN")
optionaltag NICK,local("NICK")
optionaltag SPFX,local("SPFX")
optionaltag SURN,local("SURN")
optionaltag NSFX,local("NSFX")
if @contents!="skip"
  optionaltag TRAN,local("TRAN"),@this.NAME
endif
!HideExcess

resizeWindow yes